import request from '@/utils/request'

// 查询房间表列表
export function listHouse(query) {
  return request({
    url: '/system/house/list',
    method: 'get',
    params: query
  })
}

// 查询房间表详细
export function getHouse(id) {
  return request({
    url: '/system/house/' + id,
    method: 'get'
  })
}

// 查询加入房屋的成员
export function getMember(deptId) {
  return request({
    url: '/system/house/member/' + deptId,
    method: 'get'
  })
}

// 移除加入房屋的成员
export function rmMember(userId, deptId) {
  return request({
    url: '/system/house/member/' + userId + '/' + deptId,
    method: 'delete'
  })
}

// 新增房间表
export function addHouse(data) {
  return request({
    url: '/system/house',
    method: 'post',
    data: data
  })
}

// 修改房间表
export function updateHouse(data) {
  return request({
    url: '/system/house',
    method: 'put',
    data: data
  })
}

// 删除房间表
export function delHouse(id) {
  return request({
    url: '/system/house/' + id,
    method: 'delete'
  })
}

// 导出房间表
export function exportHouse(query) {
  return request({
    url: '/system/house/export',
    method: 'get',
    params: query
  })
}
